package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.MemberProductTimeItem;
import cn.wolfcode.crm.query.PageResult;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IMemberProductTimeItemService;
import cn.wolfcode.crm.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("memberTimeItem")
public class MemberProductTimeItemController {

    @Autowired
    private IMemberProductTimeItemService service;

    @RequestMapping("list")
    @ResponseBody
    public PageResult list(QueryObject qo){
        PageResult pageResult = service.queryPage(qo);
        return pageResult;
    }
    @RequestMapping("save")
    @ResponseBody
    public JsonResult save(MemberProductTimeItem entity){
        JsonResult jr = new JsonResult();
        try {
            service.save(entity);
        } catch (Exception e) {
            e.printStackTrace();
            jr.setMsg(e.getMessage());
        }
        return jr;
    }



}
